package com.farewell.hotel.service.impl;

import com.farewell.hotel.mapper.RoomMapper;
import com.farewell.hotel.pojo.Room;
import com.farewell.hotel.service.RoomService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Farewell
 * @date 2021/4/23
 */
@Service("RoomService")
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;

    @Override
    public void setRoomToCleaning(Long roomId) {
        roomMapper.setRoomToCleaning(roomId);
    }

    @Override
    public List<Room> getRoomsByStatusWithUsed() {
        return roomMapper.getRoomsByStatusWithUsed();
    }

    @Override
    public List<Room> findSpareRoom() {
        return roomMapper.findSpareRoom();
    }

    @Override
    public List<Room> getRoomInfo() {
        return roomMapper.getRoomInfo();
    }

    @Override
    public void changeRoomFromCleanToSpareById(Long id) {
        roomMapper.changeRoomFromCleanToSpareById(id);
    }

    @Override
    public void addRoom(Room room) {
        roomMapper.addRoom(room);
    }

    @Override
    public void updateRoom(Room room) {
        roomMapper.updateRoom(room);
    }

    @Override
    public void deleteRoom(Long id) {
        roomMapper.deleteRoom(id);
    }
}
